<?php
if(isset($_POST["pid"]))
{
	require("includes/basic.php");
	$sr=1;
$class="evenrowbg";
$q=$_POST["pid"];
$tasks=mysql_query("select * from project_master as pm , task_master as tm where pm.project_id=tm.project_id and pm.project_id=$q");
if(mysql_num_rows($tasks)>0)
{
?>
	 <table width='100%' cellpadding='1' cellspacing='0' class='list'>
	<tr>
		<th width='5%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Sr no.</span>
			</div>
		</th>
        <th width='15%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Project Name</span>
			</div>
		</th>
		<th width='12%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Task Name</span>
			</div>
		</th>
		<th width='12%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Task Description</span>
			</div>
		</th>
		<th width='10%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Phase</span>
			</div>
		</th>
		<th width='10%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Task Priority</span>
			</div>
		</th>
		<th width='10%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Task Status</span>
			</div>
		</th>
		<th width='13%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Status Description</span>
			</div>
		</th>
		<th width='13%' style='white-space: nowrap;'>
			<div style='display:block; width: 20px;'>
				<span class="link linkdisabled">Estimated Time</span>
			</div>
		</th>
		
		
	 <!-- <th width='5%' class='select'>
			<form name="frm">
<input type='checkbox' class='checkbox' name='allCheck' id='listSelectAll'>
		</th> -->
	</tr>
	<tr>
	 <?php while($tasksr=mysql_fetch_array($tasks))
	{
		$taskid=$tasksr['task_id'];
		$proname=$tasksr['project_name'];
		$taskname=$tasksr['task_title'];
		$taskdesc=$tasksr['task_description'];
		$phase=$tasksr['phase_id'];
		$task_priority=$tasksr['task_priority'];
		
		$estimated_time=$tasksr['estimated_time'];
		
		
		
		if($class=="evenrowbg")
		{
			$class="oddrowbg";
		}
		else
		{
			$class="evenrowbg";
		}
		echo "<tr class='$class'><td>$sr</td>";
		echo "<td>".$proname."</td>";
		echo "<td>".$taskname."</td>";
		echo "<td>".$taskdesc."</td>";

		$qu=mysql_query("select * from phase_master where phase_id=$phase");
		$qu_fetch=mysql_fetch_array($qu);
		extract($qu_fetch);
		$ph=$qu_fetch['phase'];

		
		echo "<td>".$ph."</td><td>".$task_priority."</td>";
		
		$st=mysql_query("select * from task_status as ts, status_type as st where ts.task_status=st.status_id and ts.task_id=$taskid");
		$st_fetch=mysql_fetch_array($st);
		extract($st_fetch);
		$status=$st_fetch['status'];
		$statusdesc=$st_fetch['status_description'];

		echo "<td>".$status."</td><td>".$statusdesc."</td><td>".$estimated_time."</td>";
		
		
		
		//echo "<td><input type='checkbox' value='$userid' id='custid' name='chkName'></td>";
		$sr++;
	}

	?> 
   
</tr>
</table>

 <?php
}
}
?> 